﻿package net.wangit.framework.action;

import net.wangit.context.ActionResult;
import net.wangit.context.Message;

public abstract class AbstractActionResult implements ActionResult {
	private static final long serialVersionUID = 1L;
	private boolean successful;
	protected String url;
	private String script;
	private Message message;

	public AbstractActionResult() {
		successful = true;
		message = new Message();
	}

	public boolean isSuccessful() {
		return successful;
	}

	public void setSuccessful(boolean successful) {
		this.successful = successful;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Message getMessage() {
		return message;
	}

	public void addError(String error) {
		message.addError(error);
	}

	public void addInfo(String info) {
		message.addInfo(info);
	}

	public String getScript() {
		return script;
	}

	public void setScript(String script) {
		this.script = script;
	}

	public abstract void execute() throws Exception;
}
